﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PharmacyBussinesEntities;
//
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace PharmacyRepositoy.Mapping
{
    public class ProveedorMap:EntityTypeConfiguration<Proveedor>
    {
        public ProveedorMap()
        {
            this.HasKey(p => p.Id);
            this.Property(p => p.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(p => p.Nombre)
                .IsRequired()
                .HasMaxLength(100);
            this.Property(p => p.NumeroTelefono)
                .IsRequired().HasMaxLength(10);
            this.Property(p => p.Descripcion).IsRequired().HasMaxLength(200);
            this.ToTable("PROVEEDOR");
        }
    }
}
